/*
* $Id: ComboBoxDraw.h 65 2010-03-16 15:52:10Z volok-aleksej@yandex.ru $
*
* Copyright 2009 by Volokitin Alexey
* All rights reserved
*
*/
#ifndef _COMBOBOX_DRAW_H_
#define _COMBOBOX_DRAW_H_

#include "DrawControl.h"

class CEditorItem;

class CComboBoxDraw : public CDrawControl
{
protected:
	struct Item{
		int m_nId;
		std::tstring m_strValue;
		Item(int nIdItem, std::tstring strValueItem)
			: m_nId(nIdItem), m_strValue(strValueItem){}
	};
private:
	CEditorItem* m_pParent;
	std::vector<Item> m_aItems;
	int m_nLines;
	bool m_bPushUpScroll;
	bool m_bPushDownScroll;
	int m_nSel;
	int m_nFirstVisibleItem;
protected:
	virtual void Resize();
	virtual void PaintActive(CDC* dc);
	virtual void PaintNonActive(CDC* dc);
	void PaintControl(CDC* dc);
public:
	CComboBoxDraw(const std::tstring& strName, CEditorItem* pParent);
	virtual ~CComboBoxDraw();
public:
	virtual void SetPos(CPoint pos);
	virtual std::tstring GetValue();
public:
	void AddItem(int nIdItem, std::tstring strValueItem);
	void OffsetSelection(int i);
	void SetValue(int nId);
};

#endif/*_COMBOBOX_DRAW_H_*/